home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Mouse and Cursor / magic-wand.izs < prev    next >
Text File  |  2005-09-02  |  11KB  |  284 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Magic Wand Cursor
  4. <!/TITLE>
  5.  
  6. <!BROWSER>IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> Make the cursor on your page the center of attention for once, with this script. Kurt's superb creation renders minute glowing particles that revolve the little arrow in a 3D, circular trajectory, like in a magic wand (ok, you tell us what it looks like then). Mesmerizing as it is envious to watch!
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>mouse and cursor<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15.  
  16. <LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,1,1"></LAYER>
  17. <LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,1,1"></LAYER>
  18. <LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,1,1"></LAYER>
  19. <LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,1,1"></LAYER>
  20. <LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,1,1"></LAYER>
  21. <LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF00FF" CLIP="0,0,1,1"></LAYER>
  22. <LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,1,1"></LAYER>
  23. <LAYER NAME="a7" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,2,2"></LAYER>
  24. <LAYER NAME="a8" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,2,2"></LAYER>
  25. <LAYER NAME="a9" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,2,2"></LAYER>
  26. <LAYER NAME="a10" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,2,2"></LAYER>
  27. <LAYER NAME="a11" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,2,2"></LAYER>
  28. <LAYER NAME="a12" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#0000ff" CLIP="0,0,2,2"></LAYER>
  29. <LAYER NAME="a13" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,3,3"></LAYER>
  30.  
  31.  
  32. <script language="JavaScript">
  33.  
  34. /*
  35. Magic Wand cursor (By Kurt at kurt.grigg@virgin.net)
  36. Modified and permission granted to Dynamic Drive to feature script in archive
  37. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  38. */
  39.  
  40. if (document.all){
  41. with (document){
  42. write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
  43. write('<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px;visibility:visible"></div>')
  44. write('<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px;visibility:visible"></div>')
  45. write('<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px;visibility:visible"></div>')
  46. write('<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px;visibility:visible"></div>')
  47. write('<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px;visibility:visible"></div>')
  48. write('<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px;visibility:visible"></div>')
  49. write('<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px;visibility:visible"></div>')
  50. write('<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px;visibility:visible"></div>')
  51. write('<div style="position:relative;width:2px;height:2px;background:#fff000;font-size:2px;visibility:visible"></div>')
  52. write('<div style="position:relative;width:2px;height:2px;background:#ffa000;font-size:2px;visibility:visible"></div>')
  53. write('<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px;visibility:visible"></div>')
  54. write('<div style="position:relative;width:2px;height:2px;background:#00ff00;font-size:2px;visibility:visible"></div>')
  55. write('<div style="position:relative;width:2px;height:2px;background:#0000ff;font-size:2px;visibility:visible"></div>')
  56. write('<div style="position:relative;width:3px;height:3px;background:#FF0000;font-size:3px;visibility:visible"></div>')
  57. write('</div>')
  58. }
  59. }
  60.  
  61.  
  62. var Clrs=new Array(6)
  63. Clrs[0]='ff0000';
  64. Clrs[1]='00ff00';
  65. Clrs[2]='000aff';
  66. Clrs[3]='ff00ff';
  67. Clrs[4]='fff000';
  68. Clrs[5]='fffff0';
  69.  
  70.  
  71.  
  72. if (document.layers)
  73. {window.captureEvents(Event.MOUSEMOVE);}
  74. var yBase = 200;
  75. var xBase = 200;
  76. var step;
  77. var currStep = 0;
  78. var Xpos = 1;
  79. var Ypos = 1;
  80.  
  81. if (document.all)
  82. {
  83.   function MoveHandler(){
  84.   Xpos = document.body.scrollLeft+event.x;
  85.   Ypos = document.body.scrollTop+event.y;
  86.   }
  87.   document.onmousemove = MoveHandler;
  88. }
  89.  
  90. else if (document.layers)
  91. {
  92.   function xMoveHandler(evnt){
  93.   Xpos = evnt.pageX;
  94.   Ypos = evnt.pageY;
  95.   }
  96.   window.onMouseMove = xMoveHandler;
  97. }
  98.  
  99. function animateLogo() {
  100. if (document.all)
  101. {
  102.  yBase = window.document.body.offsetHeight/4;
  103.  xBase = window.document.body.offsetWidth/4;
  104. }
  105. else if (document.layers)
  106. {
  107.  yBase = window.innerHeight/4;
  108.  xBase = window.innerWidth/4;
  109. }
  110.  
  111. if (document.all)
  112. {
  113.  for ( i = 0 ; i < starsDiv.all.length ; i++ )
  114.  {step=3;
  115.   starsDiv.all[i].style.top = Ypos + yBase*Math.cos((currStep + i*4)/12)*Math.cos(0.7+currStep/200);
  116.   starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(8.2+currStep/400);
  117.   for (ai=0; ai < Clrs.length; ai++)
  118.     {
  119.      var c=Math.round(Math.random()*[ai]);
  120.     }
  121.     starsDiv.all[i].style.background=Clrs[c];
  122.  }
  123. }
  124.  
  125. else if (document.layers)
  126. {
  127.  for ( j = 0 ; j < 14 ; j++ ) //number of NS layers!
  128.  {step = 4;
  129.   var templayer="a"+j
  130.   document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(0.7+currStep/200);
  131.   document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(8.2+currStep/400);
  132.   for (aj=0; aj < Clrs.length; aj++)
  133.     {
  134.      var c=Math.round(Math.random()*[aj]);
  135.     }
  136.     document.layers[templayer].bgColor=Clrs[c]; 
  137.  }
  138. }
  139. currStep+= step;
  140. setTimeout("animateLogo()", 10);
  141. }
  142. animateLogo();
  143. // -->
  144. </script>
  145. <!-- END OF SCRIPT -->
  146. <!/SCRIPT>
  147.  
  148. <!PREVIEW>
  149. <!-- START OF SCRIPT -->
  150.  
  151. <LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,1,1"></LAYER>
  152. <LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,1,1"></LAYER>
  153. <LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,1,1"></LAYER>
  154. <LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,1,1"></LAYER>
  155. <LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,1,1"></LAYER>
  156. <LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF00FF" CLIP="0,0,1,1"></LAYER>
  157. <LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,1,1"></LAYER>
  158. <LAYER NAME="a7" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,2,2"></LAYER>
  159. <LAYER NAME="a8" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,2,2"></LAYER>
  160. <LAYER NAME="a9" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,2,2"></LAYER>
  161. <LAYER NAME="a10" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,2,2"></LAYER>
  162. <LAYER NAME="a11" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,2,2"></LAYER>
  163. <LAYER NAME="a12" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#0000ff" CLIP="0,0,2,2"></LAYER>
  164. <LAYER NAME="a13" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,3,3"></LAYER>
  165.  
  166.  
  167. <script language="JavaScript">
  168.  
  169. /*
  170. Magic Wand cursor (By Kurt at kurt.grigg@virgin.net)
  171. Modified and permission granted to Dynamic Drive to feature script in archive
  172. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  173. */
  174.  
  175. if (document.all){
  176. with (document){
  177. write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
  178. write('<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px;visibility:visible"></div>')
  179. write('<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px;visibility:visible"></div>')
  180. write('<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px;visibility:visible"></div>')
  181. write('<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px;visibility:visible"></div>')
  182. write('<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px;visibility:visible"></div>')
  183. write('<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px;visibility:visible"></div>')
  184. write('<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px;visibility:visible"></div>')
  185. write('<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px;visibility:visible"></div>')
  186. write('<div style="position:relative;width:2px;height:2px;background:#fff000;font-size:2px;visibility:visible"></div>')
  187. write('<div style="position:relative;width:2px;height:2px;background:#ffa000;font-size:2px;visibility:visible"></div>')
  188. write('<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px;visibility:visible"></div>')
  189. write('<div style="position:relative;width:2px;height:2px;background:#00ff00;font-size:2px;visibility:visible"></div>')
  190. write('<div style="position:relative;width:2px;height:2px;background:#0000ff;font-size:2px;visibility:visible"></div>')
  191. write('<div style="position:relative;width:3px;height:3px;background:#FF0000;font-size:3px;visibility:visible"></div>')
  192. write('</div>')
  193. }
  194. }
  195.  
  196.  
  197. var Clrs=new Array(6)
  198. Clrs[0]='ff0000';
  199. Clrs[1]='00ff00';
  200. Clrs[2]='000aff';
  201. Clrs[3]='ff00ff';
  202. Clrs[4]='fff000';
  203. Clrs[5]='fffff0';
  204.  
  205.  
  206.  
  207. if (document.layers)
  208. {window.captureEvents(Event.MOUSEMOVE);}
  209. var yBase = 200;
  210. var xBase = 200;
  211. var step;
  212. var currStep = 0;
  213. var Xpos = 1;
  214. var Ypos = 1;
  215.  
  216. if (document.all)
  217. {
  218.   function MoveHandler(){
  219.   Xpos = document.body.scrollLeft+event.x;
  220.   Ypos = document.body.scrollTop+event.y;
  221.   }
  222.   document.onmousemove = MoveHandler;
  223. }
  224.  
  225. else if (document.layers)
  226. {
  227.   function xMoveHandler(evnt){
  228.   Xpos = evnt.pageX;
  229.   Ypos = evnt.pageY;
  230.   }
  231.   window.onMouseMove = xMoveHandler;
  232. }
  233.  
  234. function animateLogo() {
  235. if (document.all)
  236. {
  237.  yBase = window.document.body.offsetHeight/4;
  238.  xBase = window.document.body.offsetWidth/4;
  239. }
  240. else if (document.layers)
  241. {
  242.  yBase = window.innerHeight/4;
  243.  xBase = window.innerWidth/4;
  244. }
  245.  
  246. if (document.all)
  247. {
  248.  for ( i = 0 ; i < starsDiv.all.length ; i++ )
  249.  {step=3;
  250.   starsDiv.all[i].style.top = Ypos + yBase*Math.cos((currStep + i*4)/12)*Math.cos(0.7+currStep/200);
  251.   starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(8.2+currStep/400);
  252.   for (ai=0; ai < Clrs.length; ai++)
  253.     {
  254.      var c=Math.round(Math.random()*[ai]);
  255.     }
  256.     starsDiv.all[i].style.background=Clrs[c];
  257.  }
  258. }
  259.  
  260. else if (document.layers)
  261. {
  262.  for ( j = 0 ; j < 14 ; j++ ) //number of NS layers!
  263.  {step = 4;
  264.   var templayer="a"+j
  265.   document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(0.7+currStep/200);
  266.   document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(8.2+currStep/400);
  267.   for (aj=0; aj < Clrs.length; aj++)
  268.     {
  269.      var c=Math.round(Math.random()*[aj]);
  270.     }
  271.     document.layers[templayer].bgColor=Clrs[c]; 
  272.  }
  273. }
  274. currStep+= step;
  275. setTimeout("animateLogo()", 10);
  276. }
  277. animateLogo();
  278. // -->
  279. </script>
  280.  
  281. <!-- END OF SCRIPT -->
  282. <!/PREVIEW>
  283.  
  284. <!RELATED>NONE<!/RELATED>